import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs";
const baseUrl = Vue.prototype.$itsoftUI.config.serviceUrl + "/apartment"
//区域管理
const apiArea = {
    //列表
    List: function () {
        const data = {};
        return request({
            url: baseUrl + "/houseArea/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //
    areaList: function (fields, page) {
        const data = { fields, page };
        return request({
            url: baseUrl + "/houseArea/list",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //区域下拉
    GetAreaList: function () {
        const data = {};
        return request({
            url: baseUrl + "/homeInspection/getAreaList",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //提取信息
    Get: function (id) {
        const data = {
            id
        };
        return request({
            url: baseUrl + "/houseArea/get",
            method: "post",
            data: qs.stringify(data)
        });
    },
    // 删除
    Del: function (ids) {
        const data = {
            ids
        }
        return request({
            url: baseUrl + "/houseArea/delete",
            method: "post",
            data: qs.stringify(data)
        });
    },
    Edit: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/houseArea/save", data, config)
    }
}
export { apiArea }